using System;
using Sinacor.Servico.Bovespa.Ordens.Service.DataContract.Request;
using Sinacor.Servico.Bovespa.Ordens.BusinessEntity;

namespace Sinacor.Servico.Bovespa.Ordens.Service.ServiceImplementation.Translator
{
    public static class TranslateConsultarOrdensNegocioRequest
    {
        public static BusinessEntity.Ordem ToOrdem(DataContract.Request.ConsultarOrdensNegocioRequest from)
        {
            BusinessEntity.Ordem to = new BusinessEntity.Ordem();
            to.DataPregao = from.DataPregao;
            to.Bolsa = from.Bolsa;
            //to.Cliente.Apelido = from.Cliente;            
            to.Titulo = from.Titulo;            
            return to;
        }

        public static BusinessEntity.Negocio ToNegocio(DataContract.Request.ConsultarOrdensNegocioRequest from)
        {
            BusinessEntity.Negocio to = new BusinessEntity.Negocio();
            to.DataPregao = from.DataPregao;
            to.Bolsa = from.Bolsa;         
            to.Titulo.Codigo = from.Titulo;
            to.NumeroNegocio = from.NumeroNegocio;
            to.TipoNaturezaOperacao = (BusinessEntity.Enum.TipoNaturezaOperacao) from.TipoNaturezaOperacao;
            return to;
        }
    }
}